home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cbibcode.arc / PIESLICE.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-05  |  815 b   |  31 lines

  1.                                             /* pieslice .c */
  2.                                  /* Entered by A. Wayner */
  3.  
  4. # include <graphics.h>
  5. char fillpattern[8] =
  6. {    0xf0, 0xf0, 0xf0, 0xf0,     0xf, 0xf, 0xf, 0xf };
  7.  
  8. main()
  9. {
  10.     int graphdriver = DETECT;
  11.     int graphmode;
  12.  
  13.                                             /* Detect adapter type and    */
  14.                                             /* initialize graphics system */
  15.       initgraph( &graphdriver, &graphmode, "\\turboc");
  16.     outtextxy( 10, 10, "Demonstrating 'pieslice' ");
  17.  
  18.                                             /* Draw two slices of pie */
  19.     setfillstyle( SLASH_FILL, RED );
  20.     pieslice( 100, 100, 0, 45, 50 );
  21.  
  22.     setfillpattern( fillpattern, YELLOW );
  23.    pieslice( 100, 100, 46, 360, 50 );
  24.  
  25.     outtextxy( 10, getmaxy() - 30,"Press any key to exit : ");
  26.  
  27.     getch();                                /* Wait until a key is pressed */
  28.     closegraph();                        /* Exit graphics library */
  29.  
  30. }
  31.